            /*准备一些东西*/
            $(document).ready(function(){
                   $(".haodian ul li").hover(
                     function(){
                        $(this).find(".haodian_zhezhao").show();
                     },function(){

                     $(this).find(".haodian_zhezhao").hide();
                    });
                    
                    $(".itme").hover(
                     function(){
                        $(this).find(".itme_zhezhao").show();
                       
                     },function(){
                        
                        $(this).find(".itme_zhezhao").hide();
                    });
                    
                    $(".nvzhuang_hover").hover(
                     function(){
                        $(this).find(".nvzhuang_itme_zhezhao").fadeIn();
                     },function(){

                     $(this).find(".nvzhuang_itme_zhezhao").fadeOut();
                    });
                    
                    
                    $('#data').on('mouseenter',".itme",function(){
                    	  $(this).find(".itme_zhezhao").show();
                        $(this).find(".mai").css("color","red");
                    }).on('mouseleave',".itme",function(){
                    	 $(this).find(".mai").css("color","333");
                        $(this).find(".itme_zhezhao").hide();
                    });
                                        
                    
                    if(ispc!=true){
                        $(".header-main-logo").attr("href","javascript:showmenu()")
                    }
                });
                
              
            /*常用的变量*/
            var ispc=IsPC();
 
            var flag = true; 
             
            
            
            /*准备一些东西*/
            
            
            
            /*load loadmore*/
            function loadmore(obj) {  
                        var scrollTop = $(obj).scrollTop();                         //目前所在的位置  
                        var scrollHeight = $(document).height();                    //文章一共有多长  
                        var windowHeight = $(obj).height();                         //一页一共有多长  
                        if (scrollHeight - (scrollTop + windowHeight) < 300) {      //20的意思是预留长度，总不能翻页到最底下才加载把~  
                            if (flag) { 
                                
                                    page=page+1
                                    more()
                                /*if(ispc){
                                    
                                }else{
                                    
                                }*/
                            //alert(1);                                           //到底了在这里请求新的一页，这里可以放ajax获取新一页  
                            flag = false;
                            };
                            
                        }
                }
            /*load loadmore*/
            
            /*more*/
            function more() { 
                   $.getJSON("Index/jsoncat",{"data":15487165,"r":r,"px":px,"cid":cid,"page":page,"kw":kw}, function(data){ 
                            for(x=0;x<data.data.length;x++){
                                $("#data").append("<div class='itmes'>\
                                                        <a href='./read-"+data.data[x].id+".html'target='_blank'>\
                                                            <div class='itme'>\
                                                            <div class='itme_zhezhao write'></div>\
                                                                <div class='img'>\
                                                                    <img src='"+data.data[x].img+"'/>\
                                                                </div>\
                                                                <p class='title'>"+data.data[x].title+"</p>\
                                                                <span class='center'><h3>"+data.data[x].price+"元</h3></span>\
                                                                <div class='clear'></div>\
                                                                <span  class='quan left'>券"+data.data[x].qprice+"元</span>\
                                                                <a href='./read-"+data.data[x].id+".html' class='mai right'>立即购买</a>\
                                                            <div class='clear'></div>\
                                                            </div>\
                                                        </a>\
                                                    </div>")
                            }
                            flag = true;
                    });
            }; 
            /*more*/
           /* 弹出面板的展示和隐藏*/
            function menuIn(){
                $('#menu').fadeIn('slow', function() {});
            }
            function menuOut(){
                $('#menu').fadeOut('slow', function() {});
            }
            /* 弹出面板的展示和隐藏*/
            
            
            /*判断手机或者电脑，用于下拉加载*/
            function IsPC() {
                var userAgentInfo = navigator.userAgent;
                var Agents = ["Android", "iPhone",
                            "SymbianOS", "Windows Phone",
                            "iPad", "iPod"];
                var ispc = true;
                for (var v = 0; v < Agents.length; v++) {
                    if (userAgentInfo.indexOf(Agents[v]) > 0) {
                        ispc = false;
                        break;
                    }
                }
                 
                return ispc;
            }
            /*判断手机或者电脑，用于下拉加载*/
            
            
            /*搜索动作跳转页面*/
            function doSearch(){
                kw=$("[name='search']").val();
                window.location.href="./s?kw="+kw;
            }
            /*搜索动作跳转页面*/
            
            /* kw Input 绑定回车事件*/
            $(document).ready(function(){
                
                $("[name='search']").bind('keypress',function(event){  
                    if(event.keyCode == "13")      
                    {  
                        doSearch();
                    }  
                });  
            });
            /* kw Input 绑定回车事件*/
            
            /*AJAX开始和结束绑定事件*/
            $(document).ajaxStart(function() {
                  console.log("get start")
                  $('.tishi').html("正在加载φ(>ω<*) ...")
                  $('.tishi').fadeIn('slow', function() {});
            });
            $(document).ajaxSuccess(function() {
                  console.log("get end")
                  $('.tishi').html("加载完成了٩(๑❛ᴗ❛๑)۶！")
                  $('.tishi').fadeOut('slow', function() {});
            });
             /*AJAX开始和结束绑定事件*/
             
             
            /* 根据cid返回分类的名字*/
            function get_fenlei(cid){
                var Cids=new Array("全部商品","女装","母婴","化妆品","居家","鞋包配饰","美食","文体车品","数码","男装","内衣")
                var fenlei=Cids[cid]
                return fenlei;
            }
            /* 根据cid返回分类的名字*/
            
            
            //写cookies
            function setCookie(name,value)
            {
            var Days = 30;
            var exp = new Date();
            exp.setTime(exp.getTime() + Days*24*60*60*1000);
            document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
            }
            
            //读取cookies
            function getCookie(name)
            {
            var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
            if(arr=document.cookie.match(reg))
            return unescape(arr[2]);
            else
            return null;
            }
            
            
            
            function showsearch(){
                $(".search").show()
                $(".hidesearch").show()
            }
            function hidesearch(){
                $(".search").hide()
                $(".hidesearch").hide()
            }
            
            function showmenu(){
                $(".m_menu").fadeIn();
            }
            function hidemenu(){
                $(".m_menu").fadeOut();
            }